@extends('Home.Index.index')
@section('title')
    注册
@endsection
@section('tag')

@endsection
@section('content')
<section id="main" class="entire_width">
    <div class="container_12">
        <div id="content">
            <div class="grid_12">
                <h1 class="page_title">创建一个帐户</h1>
            </div><!-- .grid_12 -->

            <div class="grid_6 new_customers">
                假装是图片

            </div><!-- .grid_6 -->

            <div class="grid_6">
                <form class="registed" method="post" action="">
                    <h2>用户注册</h2>

                    <div class="username">
                        <strong>用户名：</strong><sup class="surely">*</sup><br/>
                        <input type="text" name="username" value="" id="username" style="width:300px"/>
                    </div><!-- .email -->

                    <div class="password">
                        <strong>设置密码：</strong><sup class="surely">*</sup><br/>
                        <input type="password" name=""  value="" id="passwd" style="width:300px"/>
                    </div><!-- .password -->

                    <div class="repasswd">
                        <strong>确认密码：</strong><sup class="surely">*</sup><br/>
                        <input type="password" name=""  value="" id="repasswd" style="width:300px"/>
                    </div><!-- .password -->
                    <div class="mobile">
                        <strong>手机：</strong><sup class="surely">*</sup><br/>
                        <input type="text" name=""  value="" id="mobile" style="width:300px"/>
                    </div><!-- .password -->
                    <div class="phonecode">
                        <strong>手机验证码：</strong><sup class="surely">*</sup><br/>
                        <input type="text" name=""  id="phonecode" style="width:90px "/>
                        <input type="button" name=""  value="点他-->" id="pcode" style="width:100px;height: 35px "/>
                        <input type="button" value="获取验证码" id="get-code" >


                    </div><!-- .password -->
                    <div class="">
                        <button type="button" class="" style="width: 320px" id="but">&nbsp;&nbsp; &nbsp; 登录 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</button>
                    </div><!-- .submit -->
                </form><!-- .registed -->
            </div><!-- .grid_6 -->
        </div><!-- #content -->

        <div class="clear"></div>
    </div><!-- .container_12 -->
</section><!-- #main -->

<div class="clear"></div>
<script>
    $(document).ready(function() {
        $("select").selectBox();
    });

    $(function () {

       $('#but').click(function () {
           var username = $('#username').val();
           var passwd = $('#passwd').val();
           var repasswd = $('#repasswd').val();
           var mobile = $('#mobile').val();
           var phonecode = $('#phonecode').val();
            console.log(phonecode);
           $.post('',{username:username,passwd:passwd,repasswd:repasswd,mobile:mobile,phonecode:phonecode},function(e){
               console.log(e);
               if(e.status)
               {
                   window.location.href="/";

               }else {
                   layer.msg(e.info,{icon:5});
               }
           });
       });

       $('#get-code').click(function () {

           $.post('get_code',{},function (e) {
                console.log(e);
                $('#pcode').val(e);
           });
       });
    })

</script>
@endsection
